<?php

header("content-type:text/html;charset=utf-8");
$link = mysqli_connect('localhost','root','');
if ( mysqli_connect_errno($link)) {
    die(mysqli_connect_error($link));
} 
mysqli_select_db($link,'test');
mysqli_set_charset($link,'utf8');

$sql= 'select * from user';
// INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....)
// $sql = "insert into user (`name`,`age·) values ('小刘','33')";

// UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值
//$sql = "update user set `name` = '法老之鹰' where `id` = '7'";

//DELETE FROM 表名称 WHERE 列名称 = 值
//$sql = "delete from user where id='7'";
$result = mysqli_query($link,$sql);

$list=array();
if($a=mysqli_affected_rows($link) > 0){
    while($row = mysqli_fetch_assoc($result)){
    $list[]=$row;
    }
}
// echo $a;
var_dump($list);
mysqli_close($link);


?>
